using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._DataComparison
{
    /// <summary>
    /// <para>Detect Feature Changes</para>
    /// <para>Finds where the update line features spatially match the base line features and detects spatial changes, attribute changes, or both, as well as no change. It then creates an output feature class containing matched update features with information about their changes, unmatched update features, and unmatched base features.</para>
    /// <para>查找更新线要素在空间上与基线要素匹配的位置，并检测空间变化和/或属性更改，以及无变化。然后，它将创建一个输出要素类，其中包含匹配的更新要素，以及有关其更改、不匹配更新要素和不匹配基本要素的信息。</para>
    /// </summary>    
    [DisplayName("Detect Feature Changes")]
    public class DetectFeatureChanges : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public DetectFeatureChanges()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_update_features">
        /// <para>Update Features</para>
        /// <para>The line features that will be compared to the base features.</para>
        /// <para>将与基本要素进行比较的线要素。</para>
        /// </param>
        /// <param name="_base_features">
        /// <para>Base Features</para>
        /// <para>The line features that will be compared to the update features for change detection.</para>
        /// <para>将与更新要素进行比较以进行更改检测的线要素。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The output line feature class containing the change information. The output contains all participating update features (matched and unmatched) and any unmatched base features.</para>
        /// <para>包含更改信息的输出线要素类。输出包含所有参与的更新功能（匹配和不匹配）以及任何不匹配的基本功能。</para>
        /// </param>
        /// <param name="_search_distance">
        /// <para>Search Distance</para>
        /// <para>The distance used to search for match candidates. A distance must be specified and it must be greater than zero. You can choose a preferred unit; the default is the feature unit.</para>
        /// <para>用于搜索匹配候选项的距离。必须指定距离，并且该距离必须大于零。您可以选择首选单位;默认值为要素单位。</para>
        /// </param>
        public DetectFeatureChanges(object _update_features, object _base_features, object _out_feature_class, string? _search_distance)
        {
            this._update_features = _update_features;
            this._base_features = _base_features;
            this._out_feature_class = _out_feature_class;
            this._search_distance = _search_distance;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Detect Feature Changes";

        public override string CallName => "management.DetectFeatureChanges";

        public override List<string> AcceptEnvironments => ["extent", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_update_features, _base_features, _out_feature_class, _search_distance, _match_fields, _out_match_table, _change_tolerance, _compare_fields, _compare_line_direction.GetGPValue()];

        /// <summary>
        /// <para>Update Features</para>
        /// <para>The line features that will be compared to the base features.</para>
        /// <para>将与基本要素进行比较的线要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Update Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _update_features { get; set; }


        /// <summary>
        /// <para>Base Features</para>
        /// <para>The line features that will be compared to the update features for change detection.</para>
        /// <para>将与更新要素进行比较以进行更改检测的线要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Base Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _base_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The output line feature class containing the change information. The output contains all participating update features (matched and unmatched) and any unmatched base features.</para>
        /// <para>包含更改信息的输出线要素类。输出包含所有参与的更新功能（匹配和不匹配）以及任何不匹配的基本功能。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Search Distance</para>
        /// <para>The distance used to search for match candidates. A distance must be specified and it must be greater than zero. You can choose a preferred unit; the default is the feature unit.</para>
        /// <para>用于搜索匹配候选项的距离。必须指定距离，并且该距离必须大于零。您可以选择首选单位;默认值为要素单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Search Distance")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string? _search_distance { get; set; }


        /// <summary>
        /// <para>Match Fields</para>
        /// <para>The match fields from the update and base features. If specified, each pair of fields are compared for match candidates to help determine the right match.</para>
        /// <para>更新和基本要素中的匹配字段。如果指定，则将比较每对字段的匹配候选项，以帮助确定正确的匹配项。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Match Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _match_fields { get; set; } = null;


        /// <summary>
        /// <para>Output Match Table</para>
        /// <para>The output table containing complete feature matching information.</para>
        /// <para>包含完整要素匹配信息的输出表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Match Table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_match_table { get; set; } = null;


        /// <summary>
        /// <para>Change Tolerance</para>
        /// <para>The distance used to determine if there is a spatial change. All matched update features and base features are compared to this tolerance. If any portions of the update or the base features fall outside the zone around the matched feature, it is considered a spatial change. The value must be greater than the XY Tolerance of the input data so this process can be performed and the output will include the LEN_PCT and LEN_ABS fields. The default is 0, meaning this process is not performed. Any value between 0 and the data's XY Tolerance (inclusively) will make the process irrelevant and will be replaced by 0. You can choose a unit; the default is the feature unit.</para>
        /// <para>用于确定是否存在空间变化的距离。所有匹配的更新功能和基本功能都将与此容差进行比较。如果更新的任何部分或基础要素位于匹配要素周围的区域之外，则将其视为空间更改。该值必须大于输入数据的 XY 容差，以便可以执行此过程，并且输出将包括 LEN_PCT 和 LEN_ABS 字段。默认值为 0，表示不执行此过程。介于 0 和数据的 XY 容差（含）之间的任何值都将使过程变得无关紧要，并将替换为 0。您可以选择一个单位;默认值为要素单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Change Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _change_tolerance { get; set; } = "0 Unknown";


        /// <summary>
        /// <para>Compare Fields</para>
        /// <para>The fields that will determine if there is an attribute change between the matched update and base features.</para>
        /// <para>用于确定匹配的更新要素和基本要素之间是否存在属性更改的字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Compare Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _compare_fields { get; set; } = null;


        /// <summary>
        /// <para>Compare line direction</para>
        /// <para><xdoc>
        ///   <para>Specifies whether line directions will be compared for matched features.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Line directions will not be compared for matched features. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Line directions will be compared for matched features.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否比较匹配要素的线方向。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 不会比较匹配要素的线方向。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中—将比较匹配要素的线方向。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Compare line direction")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _compare_line_direction_value _compare_line_direction { get; set; } = _compare_line_direction_value._false;

        public enum _compare_line_direction_value
        {
            /// <summary>
            /// <para>COMPARE_DIRECTION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("COMPARE_DIRECTION")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_COMPARE_DIRECTION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_COMPARE_DIRECTION")]
            [GPEnumValue("false")]
            _false,

        }

        public DetectFeatureChanges SetEnv(object extent = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(extent: extent, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}